<!--根据这个页单独设置样式-->
<style>
    .table-responsive{overflow-x: inherit}
    td{ vertical-align: middle!important;}
    .pagination{ margin:0!important;}
    .flot{float: left}
    .rlot{float: right}
</style>
<div>
    <div class="bg-light lter b-b wrapper-md">
        <h1 class="m-n font-thin h3">商品评价
        </h1>
    </div>
    <div class="padder-md m-b-none m-t" style="padding-top: 0">
        <div class="panel panel-default">
            <div class="panel-heading">商品评价</div>
            <div class="m-sm">
                <div class="clearfix">
                    <h5>搜索筛选项：</h5>
                    <div class="row wrapper" style="padding-bottom:0;">
                        <div class="col-sm-3 col-md-2 col-lg-2">
                            <input class="form-control ng-pristine ng-untouched ng-valid"
                                   ng-model="ctrl.vm.search.p_id" type="text" placeholder="商品id" >
                        </div>
                        <div class="col-sm-3 col-md-2 col-lg-2">
                            <input class="form-control ng-pristine ng-untouched ng-valid"
                                   ng-model="ctrl.vm.search.u_id" type="text" placeholder="用户id" >
                        </div>
                        <div class="col-sm-3 col-md-2 col-lg-2">
                            <input class="form-control ng-pristine ng-untouched ng-valid"
                                   ng-model="ctrl.vm.search.order_id" type="text" placeholder="订单id" >
                        </div>
                        <div class="col-sm-3 col-md-2 col-lg-2">
                            <select class="form-control" ng-model="ctrl.vm.search.status">
                                <option value="">状态</option>
                                <option value="0">待审核</option>
                                <option value="1">审核通过</option>
                                <option value="-1">驳回</option>
                            </select>
                        </div>
                        <div class="col-sm-3 col-md-2 col-lg-2">
                            <div>
                                <button class="btn btn-sm btn-default" type="button" ng-click="ctrl.vm.searchFn()">搜索</button>
                                <button class="btn btn-sm btn-dark" type="button" ng-click="ctrl.vm.reset()">重置</button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="table-responsive">
                <table class="table table-striped b-t b-light">
                    <thead>
                    <tr>
                        <th>id</th>
                        <th>用户id</th>
                        <th>商品图片</th>
                        <th>商品名称</th>
                        <th>规格</th>
                        <th>评价内容</th>
                        <th>评价图片</th>
                        <th>评分</th>
                        <th>状态</th>
                        <th>时间</th>
                        <th>操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    <tr ng-repeat="data in ctrl.vm.data">
                        <td>{{data.id}}</td>
                        <td>{{data.u_id}}</td>
                        <td >
                            <!--ng-repeat="image in data.images"-->
                            <!--<span ng-if="image.is_default==1">-->
                                <img  ng-src="{{data.images[0].url | imgwhq:100:200:90}}" alt="">
                            <!--</span>-->
                        </td>
                        <td style="width: 10%">{{data.name}}</td>
                        <td>{{data.attr_value_name}}</td>
                        <td style="width: 10%">{{data.content}}</td>
                        <td>
                            <img ng-if="data.image_1!=''" ng-src="{{data.image_1 | imgwhq:100:200:90}}" alt="">
                            <img ng-if="data.image_2!=''" ng-src="{{data.image_2 | imgwhq:100:200:90}}" alt="">
                            <img ng-if="data.image_3!=''" ng-src="{{data.image_3 | imgwhq:100:200:90}}" alt="">
                        </td>
                        <td ng-if="data.image_1==''&&data.image_2==''&&data.image_3==''">无</td>
                        <td>{{data.score}}</td>
                        <td>
                            <span class="label bg-success" ng-if="data.status==1">审核通过 </span>
                            <span class="label bg-info" ng-if="data.status==0">待审核</span>
                            <span class="label bg-danger" ng-if="data.status==-1">驳回</span>
                        </td>
                        <td style="width: 10%">{{data.created_at}}</td>
                        <td>
                            <button class="btn btn-sm btn-success" ng-if="data.status==0" ng-click="ctrl.vm.approveIt(data.id)">通过</button>
                            <button class="btn btn-sm btn-danger" ng-if="data.status==0" ng-click="ctrl.vm.rejectIt(data.id)">驳回</button>
                        </td>
                    </tr>
                    <tr ng-if="!ctrl.vm.data.length">
                        <td colspan="12" class="text-center">暂无数据！</td>
                    </tr>
                    </tbody>
                </table>
            </div>
            <footer class="panel-footer">
                <div class="row">
                    <div class="col-sm-2 hidden-xs">
                        <select
                                class="input-sm form-control w-sm inline v-middle"
                                ng-model="placement.selected"
                                ng-options="o as o for o in placement.options"
                                ng-change="placement.changeFn()"
                        >
                        </select>
                        <i style="float: right;padding: 2% 15% 0 0">总计{{vm.page.total}}</i>
                    </div>
                    <div class="col-sm-10 text-right text-center-xs">
                        <div class="pagination pagination-sm m-t-none m-b-none">
                            <uib-pagination
                                    boundary-links="true"
                                    total-items="vm.page.total"
                                    max-size="placement.pageSize"
                                    items-per-page="placement.selected"
                                    ng-model="vm.page.current_page"
                                    ng-change="pageChanged()"
                                    class="pagination-sm"
                                    previous-text="&lsaquo;"
                                    next-text="&rsaquo;"
                                    first-text="&laquo;"
                                    last-text="&raquo;"
                            >
                            </uib-pagination>
                        </div>
                    </div>
                </div>
            </footer>
        </div>
    </div>
</div>